package rpc.common;

import lombok.AllArgsConstructor;
import lombok.Data;

@Data
@AllArgsConstructor
public class TaskRpc {

    /**
     * 任务调度对象
     */

    private String serverName;//节点名

    private String classify;//具体类名

    private String methodName;//方法名

    private Object[] params;//参数数组

    private Class[] paramsClass;

    public Class[] getParamsClass() {
        if(this.paramsClass!=null){
            return paramsClass;
        }
        Object[] params= this.getParams();
        Class[] paramsClass=new Class[params.length];
        for (int i = 0; i < params.length; i++) {
            paramsClass[i]=params[i].getClass();
        }
        return paramsClass;
    }

}
